package com.muyan.producer;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @Author: YLTDMenglc
 * @Date: 2019/6/20
 * @Time: 14:08
 * @Description:
 */
@Component
public class MsgProducer {

    @Autowired
    private AmqpTemplate amqpTemplate;

    public void send(String queueName){
        System.out.println("queueName:"+queueName);
        String msg = "msg:"+new Date();
        amqpTemplate.convertAndSend(queueName,msg);
    }
}
